package operator.filter;

import io.reactivex.Observable;
import io.reactivex.functions.Predicate;
import util.RxJavaHelper;

class FilterOperator {

    public static void main(String[] args) {
        filter();
    }

    /**
     * 过滤想要的
     */
    static void filter(){
        Observable.just(1, 2, 3, 4, 5)
                .filter(new Predicate<Integer>() {
                    @Override
                    public boolean test(Integer integer) throws Exception {
                        return integer > 2;
                    }
                })
                .subscribe(RxJavaHelper.getConsumer());
    }


}
